Page({
    data: {
        type: '', // 0关于我们 1用户服务协议
        article_content: ''
    },
    onLoad: function(options) {
        const type = Number(options.type)
        const article_id = options.article_id
        this.setData({ type })
        let url = `/api/article/detail?article_id=${article_id ? article_id : ['9','21'][type]}`
        this.request({
            url,
            loadingTip: '加载中',
            login: false
        }, res => {
            wx.setNavigationBarTitle({
                title: res.data.title
            })
            let article_content = res.data.article_content.content.replaceAll('<table>', '<table border="1px solid #000" cellspacing="0" cellpadding="6">')
            this.setData({ article_content: article_content })
        })
    }
})